package demo.pojo.excl;


import com.parent.excel.ExcelField;
import com.parent.excel.ExcelFieldMap;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @Author yan
 * @Date 2023/4/23 0023 17:29
 * @Description
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ExcelDataOther {
    /**
     * demo
     */
    @ExcelField(values = {"ID"})
    private Integer id;


    @Schema(description = "名称")
    @ExcelField(values = {"名称","名称1"},bool = true)
    private String name;

    @Schema(description = "类型")
    @ExcelField(values = "类型",bool = true)
    private String type;


    /**
     * 现价
     */

    @Schema(description = "金额")
    @ExcelField(values = "金额",bool = true)
    private BigDecimal amount;
    @Schema(description = "时间")
    @ExcelField(values = "时间",bool = true)
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDate time;


    public Object toDto(ExcelDataOther dto) {
        String name = dto.getName();
        String type = dto.getType();
        BigDecimal amount = dto.getAmount();
        LocalDate time = dto.getTime();

        //TODO 封装
        return null;
    }

}
